package com.twu.biblioteca;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by neilbo on 5/01/2014.
 */
public class Library {



    public List<Book> getAvailableBooks() {
        List<Book> books = new ArrayList<Book>();
        books.add(new Book("First Book"));
        books.add(new Book("Second Book"));
        books.add(new Book("Third Book"));
        return books;
    }


    public List<Movie> getAvailableMovies() {
        List<Movie> movieList = new ArrayList<Movie>();
        movieList.add(new Movie("Iron Man", 2008, "Jon Favreau", 8));
        movieList.add(new Movie("Avengers", 2012, "Joss Whedon", 10));
        movieList.add(new Movie("Inception", 2010, "Christopher Nolan", 8));
        return movieList;
    }


    public List<User> getAllUsers() {
        List<User> userList = new ArrayList<User>();
        userList.add(new User("Neil", "neil@thoughtworks.com", "0434374921", "555-5555", "password"));
        userList.add(new User("Bruce", "bruce@teneriffe.com", "0434374922", "555-5556", "password"));
        userList.add(new User("Alicia", "alicia@cardiacward.com", "0434374922", "555-5557", "password"));
        return userList;
    }


    public boolean isBookAvailable(String userInput) {
        List<Book> books = getAvailableBooks();
        int bookSize = books.size();
        for (int i = 0; i < bookSize; i++) {
                if (userInput.equals(books.get(i).getTitle())){
                    return true;
                }
            }
        return false;
    }
}
